import requests, json


def Hrm_Login():
    url = "http://localhost:8080/api/sys/login"
    data = {
        "mobile": "13800000002",
        "password": "123456"
    }
    headers = {
        "Content-Type": "application/json"
    }
    json_data = json.dumps(data)
    res = requests.post(url=url, data=json_data, headers=headers)
    token = res.json().get('data')
    return token


def show_user():
    url = 'http://localhost:8080/api/sys/user'
    params = {

        'page': 1,
        'size': 20
    }
    headers = {
        'Authorization': Hrm_Login(),
        "Content-Type": "application/json"
    }
    res = requests.get(url=url, params=params, headers=headers)
    data = res.json()
    return data



if __name__ == '__main__':
    # Hrm_Login()
    show_user()
